package com.zp.base.admin.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.zp.base.admin.common.annotation.AddGroup;
import com.zp.base.admin.common.annotation.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 
 * 
 * @author zhangpeng
 * @email zhangpeng@aliyun.com
 * @date 2021-02-28 11:15:56
 */
@Data
@TableName("zp_role")
public class RoleEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@TableId
	@NotNull(message = "修改时角色ID不能为空！", groups = {UpdateGroup.class})
	@Null(message = "添加时角色ID为空！", groups = {AddGroup.class})
	private Long id;
	/**
	 * 
	 */
	private Date createTime;
	/**
	 * 
	 */
	private Date updateTime;
	/**
	 * 角色名称
	 */
	@NotEmpty(message = "角色名称不能为空！", groups = {UpdateGroup.class, AddGroup.class})
	private String name;
	/**
	 * 
	 */
	private String remark;
	/**
	 * 角色状态   1 正常  0 冻结
	 */
	private Integer status = 1;
	/**
	 * 角色拥有的资源（权限）
	 */
	@TableField(exist = false)
	private List<MenuEntity> permissions;

}
